export function compareObject(a, b) {
    const aProps = Object.getOwnPropertyNames(a);
    const bProps = Object.getOwnPropertyNames(b);
    if (aProps.length !== bProps.length) {
        return false;
    }
    for (let i = 0; i < aProps.length; i++) {
        const propName = aProps[i];

        const propA = a[propName];
        const propB = b[propName];
        if ((typeof (propA) === 'object')) {
            return this.compareObject(propA, propB);
        } else if (propA !== propB) {
            return false
        } else {
            //
        }
    }
    return true
}


/**
 * 处理对象参数值，排除对象参数值为 '',null,undefined 并返回一个新对象
 **/
export function filterObjEmpty(obj){
    let param = {};
    if ( obj === null || obj === undefined || obj === '' ) return param;
    for (let key in obj ){
        if (typeof (obj[key]) === 'object'){
            param[key] = filterObjEmpty(obj[key]);
        } else if(obj[key] !== null && obj[key] !== undefined && obj[key] !== ''){
            param[key] = obj[key];
        }
    }
    return param;
}